package com.wisemoresystem.seal.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.ne.framework.data.model.DbModel;
import org.ne.framework.data.util.GenerateTools;

import com.wisemoresystem.seal.util.md5.MD5;

@Entity
public class t_log implements DbModel {

	@Transient
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator = "my_generator")
	@GenericGenerator(name = "my_generator", strategy = "uuid")
	@Column(length = 32)
	private String _id;

	private String company_id;// 相当于bank_id
	private String log;
	/*@Column(name = "[level]")*/
	private String level_msg;// 操作级别

	private String clazz;// 作用的类
	private String clazz_id;// 作用类_id号

	private String user_id;// 操作者
	private String ip;

	private int status;
	private Timestamp created = new Timestamp(System.currentTimeMillis());

	// ======= enum =================
	public enum Level {
		L("低"), M("中"), H("高");

		private Level(String level) {
			this.level = level;
		}

		public String toString() {
			return level.toString();
		}

		private String level;

	}

	// ======= get / set ()=================
	public String get_id() {
		return _id;
	}

	public void set_id(String _id) {
		this._id = _id;
	}

	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public String getClazz_id() {
		return clazz_id;
	}

	public void setClazz_id(String clazz_id) {
		this.clazz_id = clazz_id;
	}

	public String getLevel() {
		return level_msg;
	}

	public void setLevel(String level_msg) {
		this.level_msg = level_msg;
	}

	public String getUser_id() {
		return user_id;
	}

	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Timestamp getCreated() {
		return created;
	}

	public void setCreated(Timestamp created) {
		this.created = created;
	}

	public static void main(String[] args) {
		System.err.println(MD5.md5("123456"));
		System.err.println(GenerateTools.getBase58ID());
	}

	public String getCompany_id() {
		return company_id;
	}

	public void setCompany_id(String company_id) {
		this.company_id = company_id;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
